package dataobjects;

import java.util.Date;
public class Message {
	/*Using object types so that xml is smaller when some don't apply*/
	String nickname, message;
	Boolean active;
	Long id, latitude, longitude, categoryID, datePosted, likes, dislikes, indifferent;
	
	public Long getLikes() {
		if (likes == null) {
			return (long) 0;
		}
		return likes;
	}
	public void setLikes(Long likes) {
		this.likes = likes;
	}
	public Long getDislikes() {
		if (dislikes == null) {
			return (long) 0;
		}
		return dislikes;
	}
	public void setDislikes(Long dislikes) {
		this.dislikes = dislikes;
	}
	public Long getIndifferent() {
		if (indifferent == null) {
			return (long) 0;
		}
		return indifferent;
	}
	public void setIndifferent(Long indifferent) {
		this.indifferent = indifferent;
	}
	public Long getCategoryID() {
		return categoryID;
	}
	public void setCategoryID(Long categoryID) {
		this.categoryID = categoryID;
	}
	
	public String getNickname() {
		if (nickname == null) {
			return "Unknown";
		}
		return nickname;
	}
	
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
	public String getMessage() {
		if (message == null) {
			return "No message";
		}
		return message;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}
	
	public Boolean getActive() {
		return active;
	}
	
	public void setActive(Boolean active) {
		this.active = active;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getLatitude() {
		return latitude;
	}
	public void setLatitude(Long latitude) {
		this.latitude = latitude;
	}
	public Long getLongitude() {
		return longitude;
	}
	public void setLongitude(Long longitude) {
		this.longitude = longitude;
	}
	public Long getDatePosted() {
		if (datePosted == null) {
			return new Date().getTime();
		}
		return datePosted;
	}
	
	public Date getDate() {
		return new Date(getDatePosted());
	}
	
	public void setDatePosted(Long datePosted) {
		this.datePosted = datePosted;
	}
	
	
}
